% $Id: luca.sty,v 1.1 2006/07/17 23:56:01 luca Exp $ 
% luca.sty
% by Luca de Alfaro
% Includes also: 
% equations.sty, comment.sty, call.sty, theorem.sty 


% comment.sty
% 25-Oct-89
% By Ed -- modified from verbatim in /usr/loca/lib/tex82/latex.tex

% \begin{comment}
% \end{comment}

\begingroup \catcode `|=0 \catcode `[= 1
\catcode`]=2 \catcode `\{=12 \catcode `\}=12
\catcode`\\=12 |gdef|@xcomment#1\end{comment}[|end[comment]]
|endgroup


\def\@comment{\let\do\@makeother \dospecials\catcode`\^^M=10\def\par{}}

\def\begincomment{\@comment\@xcomment}

\newenvironment{comment}{\begincomment}{}

% =========================================================theorem.sty

% command to end a proof or definition:
%\def\qed{\rule{0.4em}{1.4ex}}
\def\qed{\hfill$\blacksquare$}

% space at the beginning of an environment:
\def\@envspa{\hspace{0.3em}}
\def\@sa{\hspace{-0.2em}}
\def\@sb{\hspace{0.5em}}
\def\@sc{\hspace{-0.1em}}
\def\sk{\smallskip}		% space before and after theorems

% new environments:

\newtheorem{@protheo}{Theorem}
\newenvironment{theo}[1]{\begin{@protheo}\@sa{\rm \bf #1}\@sb\it}{\end{@protheo}}

\newtheorem{@prodefi}{Definition}
\newenvironment{defi}[1]{\begin{@prodefi} \@sa{\rm\bf #1}\@sb\rm}{\end{@prodefi}}

\newtheorem{@proconstr}{Construction}
\newenvironment{constr}[1]{\begin{@proconstr} \@sa{\rm\bf #1}\@sb\rm}{\end{@proconstr}}

\newtheorem{@proalgo}{Algorithm}
\newenvironment{algo}[1]{\begin{@proalgo} \@sa{\rm\bf #1}\@sb\rm}{\end{@proalgo}}

\newtheorem{@procon}{Condition}
\newenvironment{cond}[1]{\begin{@procon} \@sa{\rm\bf #1}\@sb\rm}{\end{@procon}}

\newtheorem{@prorestr}{Restriction}
\newenvironment{restr}[1]{\begin{@prorestr} \@sa{\rm\bf #1}\@sb\rm}{\end{@prorestr}}

\newtheorem{@prolem}{Lemma}
\newenvironment{lem}[1]{\begin{@prolem}\@sa{\rm\bf #1}\@sb\it}{\end{@prolem}}

\newtheorem{@proprop}{Proposition}
\newenvironment{propos}[1]{\begin{@proprop}\@sa{\rm\bf #1}\@sb\it}{\end{@proprop}}

\newtheorem{@procor}{Corollary}
\newenvironment{cor}[1]{\begin{@procor}\@sa{\rm \bf #1}\@sb\it}{\end{@procor}}

%\newtheorem{@prorema}{Remark}
%\newenvironment{remark}[1]{\begin{@prorema}\@sa{\rm \bf #1}\@sb\rm}{\end{@prorema}}

\newtheorem{@proassu}{Assumption}
\newenvironment{assu}[1]{\begin{@proassu}\@sa{\rm \bf #1}\@sb\rm}{\end{@proassu}}

\newtheorem{@proprob}{Problem}
\newenvironment{prob}{\begin{@proprob}\@envspa\rm}{\end{@proprob}}

\newtheorem{@prolprob}{Linear Programming Problem}
\newenvironment{lpprob}{\begin{@prolprob}\@envspa\rm}{\end{@prolprob}}

\newtheorem{@proexe}{Exercise}
\newenvironment{exer}{\begin{@proexe}\@envspa\rm}{\qed\end{@proexe}}

\newtheorem{@proexa}{Example}
\newenvironment{examp}[1]{\begin{@proexa}\@sa{\rm \bf #1}\@sb\rm}{\end{@proexa}}

\newtheorem{@pronota}{Note}
\newenvironment{nota}{\begin{@pronota} \rm \footnotesize}{\par\end{@pronota}}

\newtheorem{@prorego}{Rule}
\newenvironment{regola}[1]{\begin{@prorego} \@sa{\rm\bf #1}\@sb\rm}{\end{@prorego}}

\newtheorem{@proassert}{Assertion}
\newenvironment{assertion}[1]{\begin{@proassert} \@sa{\rm\bf #1}\@sb\it}{\end{@proassert}}

%\def\@proofbugbegin{
%\noindent}
%\def\@proofbugend{
%\qed
%\medskip}

%\newenvironment{proof}{\@proofbugbegin {\bf Proof.}\@envspa}{
%\@proofbugend\smallskip}

\newenvironment{prsk}{\paragraph{Proof {\rm (sketch).}}}{\medskip}

\def\proofsketch{\paragraph{Proof {\rm (sketch).}}}
\def\proof{\paragraph{Proof}}

\def\subpar#1{\par \smallskip \noindent {\em #1}}

%\def\theorem{\theo}

% ===================================================================== call.sty 

\def\cala{{\cal A}}
\def\calb{{\cal B}}
\def\calc{{\cal C}}
\def\cald{{\cal D}}
\def\cale{{\cal E}}
\def\calf{{\cal F}}
\def\calg{{\cal G}}
\def\calh{{\cal H}}
\def\cali{{\cal I}}
\def\calj{{\cal J}}
\def\calk{{\cal K}}
\def\call{{\cal L}}
\def\calm{{\cal M}}
\def\caln{{\cal N}}
\def\calo{{\cal O}}
\def\calp{{\cal P}}
\def\calq{{\cal Q}}
\def\calr{{\cal R}}
\def\cals{{\cal S}}
\def\calt{{\cal T}}
\def\calu{{\cal U}}
\def\calv{{\cal V}}
\def\calw{{\cal W}}
\def\calx{{\cal X}}
\def\caly{{\cal Y}}
\def\calz{{\cal Z}}

% ========================================================== (old tl.sty, edited)

% Generic mathematical symbols 

\def\eqpun{\;}				% space after eq for punct
\def\subs{\subseteq}
\def\Dom{\mbox{\rm Dom}\,}
\def\Im{\mbox{\rm Im}\,}
\def\sat{\models}			% |=
\def\stsat{\mid\!\sat}			% ||=
\def\defined{\stackrel{\rm def}{=}}	% = w. 'def' on top
\def\union{\cup}
\def\inters{\cap}
\def\eqspa{\hspace*{2em}}	% space betw. equation on the same line 
\def\semb#1{[\![ #1 ]\!]}		% [[ #1 ]]
\def\tuple#1{\langle #1 \rangle}		% < #1 >
\def\go{\rightarrow} 			% -->
\def\setm{\setminus}			% \
\def\ita#1{{\text{\textit{#1}}}}        % to italicise something

% Logical operators 

\def\im{\Rightarrow}			% implication
\def\biim{\,\Leftrightarrow\,}		% biimplication
\def\no{\neg}				% negation (alias for \neg)
\def\und{\wedge}			% and 
\def\oder{\vee}				% or
\def\true{\mbox{\sc t}}			% T for true
\def\false{\mbox{\sc f}}		% F for false
\def\qdot{\:.\:}			% . for quantification
\def\@spartx{\hspace{0.4em}}
\def\tiff{\ita{\@spartx iff \@spartx}}
\def\tand{\ita{\@spartx and \@spartx}}
\def\tor{\ita{\@spartx or \@spartx}}
\def\timplies{\ita{\@spartx implies \@spartx}}
\def\tnot{\ita{\@spartx not \@spartx}}

% text fonts

\def\xit#1{{\text{\textit{#1}}}}
\def\xem#1{{\text{\emph{#1}}}}
\def\xtt#1{{\text{\texttt{#1}}}} 
\def\xbf#1{{\text{\textbf{#1}}}} 

% standard TL operators

\def\@bo{{\raisebox{-0.2ex}{$\Box$}}}		% internal 
\def\@dia{{\raisebox{-0.2ex}{$\Diamond$}}}	% internal 
\def\bo{\@bo}					% box
\def\diam{{\@dia}}				% diamond
\def\until{\mbox{$\:\cal U\,$}}		        % U
\def\unless{\mbox{$\:\cal W\:$}}		% W
\def\awaits{\mbox{$\:\cal W\:$}}		% W
\def\since{\mbox{$\:\cal S\:$}}		        % S
\def\backto{\mbox{$\:\cal B\:$}}		% B
\def\pbox{\mbox{\rm\makebox[0em][l]{$\@bo$}\makebox[0.8em]{--}}} % past box
\def\pdiam{\mbox{\rm\makebox[0em][l]{$\@dia$}\makebox[0.8em]{--}\hspace{0.05em}}} % past diamond
%\def\prev{\mbox{\rm\makebox[0em][l]{$\next$}\makebox[1.0em]{$-$}\,}} % previous 

%\def\next{\begin{picture}(8,6)(-4,-2) \put(0,1){\circle{6}} \end{picture}}
\def\prev{\begin{picture}(8,6)(-4,-2)
\put(0,1){\circle{6}} 
\put(-3,1){\line(1,0){6}}
\end{picture}}

% To put notes
\def\mynote#1{$\clubsuit$ {\sf #1 } $\clubsuit$}
%\def\mynote#1{}

% Misc enhancements to LaTeX

\def\beq{\begin{equation}}
\def\eeq{\end{equation}}

% Naming equations or axioms: use \begin{namedeq}{EQ} to obtain
% an equation labelled with name (EQ). This does not disrupt the 
% numbering of the equations. It is to be used when the \theequation
% comand is normally set to \arabic{equation}, otherwise a new environment
% with the appropriate end text should be defined.

% Naming equations or axioms, for eqnarray: use \begin{namedeqar}{EQ-} to
% obtain equations named (EQ-1), (EQ-2), ...
% As the above, this works if arabic is the default.
% \newenvironment{namedeqar}[1]{\renewcommand{\theequation}{#1\arabic{
% to be completed: need to declare a counter

% This fixes a bug in equations.sty, having to do with the way
% equations behave when fleqn.sty is also used.
% do not use eqalign. Instead:
% better version of eqalignno (with number):

% bold letters from llncs:

\def\bbbb{{\rm I\!B}}
\def\bbbr{{\rm I\!R}} %reelle Zahlen
\def\bbbm{{\rm I\!M}}
\def\bbbn{{\rm I\!N}} %natuerliche Zahlen
\def\bbbf{{\rm I\!F}}
\def\bbbh{{\rm I\!H}}
\def\bbbk{{\rm I\!K}}
\def\bbbp{{\rm I\!P}}
\def\bbbone{{\mathchoice {\rm 1\mskip-4mu l} {\rm 1\mskip-4mu l}
{\rm 1\mskip-4.5mu l} {\rm 1\mskip-5mu l}}}
\def\bbbc{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm C$}\hbox{\hbox
to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\textstyle\rm C$}\hbox{\hbox
to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptstyle\rm C$}\hbox{\hbox
to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptscriptstyle\rm C$}\hbox{\hbox
to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}}}
\def\bbbq{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm
Q$}\hbox{\raise
0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}}
{\setbox0=\hbox{$\textstyle\rm Q$}\hbox{\raise
0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptstyle\rm Q$}\hbox{\raise
0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptscriptstyle\rm Q$}\hbox{\raise
0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}}}}
\def\bbbt{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm
T$}\hbox{\hbox to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\textstyle\rm T$}\hbox{\hbox
to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptstyle\rm T$}\hbox{\hbox
to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptscriptstyle\rm T$}\hbox{\hbox
to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}}}
\def\bbbs{{\mathchoice
{\setbox0=\hbox{$\displaystyle     \rm S$}\hbox{\raise0.5\ht0\hbox
to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox
to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}}
{\setbox0=\hbox{$\textstyle        \rm S$}\hbox{\raise0.5\ht0\hbox
to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox
to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptstyle      \rm S$}\hbox{\raise0.5\ht0\hbox
to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox
to0pt{\kern0.5\wd0\vrule height0.45\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptscriptstyle\rm S$}\hbox{\raise0.5\ht0\hbox
to0pt{\kern0.4\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox
to0pt{\kern0.55\wd0\vrule height0.45\ht0\hss}\box0}}}}
\def\bbbz{{\mathchoice {\hbox{$\sf\textstyle Z\kern-0.4em Z$}}
{\hbox{$\sf\textstyle Z\kern-0.4em Z$}}
{\hbox{$\sf\scriptstyle Z\kern-0.3em Z$}}
{\hbox{$\sf\scriptscriptstyle Z\kern-0.2em Z$}}}}

\def\reals{\bbbr}			% the set of reals R
\def\naturals{\bbbn}			% the set of naturals N


